<template>
  <div class="goodsDesc">
    <!-- 头部 -->
    <headers text="黑马商城" style=" position: fixed;
  top: 0;
  left: 0;
  width: 100%;">
      <template #left>
        <van-icon name="arrow-left" @click="$router.back()" />
      </template>
    </headers>
    <div class="main" style="margin-top:40px">
      <h2>{{ descList.title }}</h2>
      <p class="content" v-html="descList.content"></p>
    </div>

    <!-- 底部 -->
    <footers :list="goods"></footers>
  </div>
</template>

<script>
import headers from "@/components/headers.vue";
import footers from "@/components/footers.vue";
import { getdesc } from "@/apis/goods";
export default {
  components: {
    headers,
    footers,
  },
  data() {
    return {
      goods: [
        {
          icon: "icon-jia1",
          text: "首页",
          name: "index",
        },
        {
          icon: "icon-huiyuan",
          text: "会员",
          name: "info",
        },
        {
          icon: "icon-gouwuche",
          text: "购物车",
          name: "shop",
        },
        {
          icon: "icon-1-1",
          text: "搜索",
          name: "serach",
        },
      ],
      descList: [],
    };
  },
  async mounted() {
    let res = await getdesc(this.$route.params.id);
    console.log(res);
    this.descList = res.data.message[0];
  },
};
</script>

<style lang='less' scoped>
.goodsDesc {
  padding-bottom: 50px;
}
@import url("//at.alicdn.com/t/font_2621049_2wy8jxt71aw.css");
.main {
  padding: 10px 20px;
  h2 {
    font-size: 16px;
    color: #0088d1;
    border-bottom: 2px solid #ccc;
    padding: 10px 0;
    margin-bottom: 10px;
  }

  /deep/.gomeImgLoad {
    width: 100%;
  }
  /deep/ table {
    width: 100%;
  }
  /deep/ img {
    width: 100%;
  }
}
</style>
